/**
 * Copyright (C), 2015-2018, XXX有限公司
 * FileName: UserServiceImpl
 * Author:   周宏硕
 * Date:     2018/10/29 15:26
 * Description:
 * History:
 * <author>          <time>          <version>          <desc>
 * 作者姓名           修改时间           版本号              描述
 */
package com.htwx.service.Impl;

import com.htwx.dao.UserDao;
import com.htwx.entity.User;
import com.htwx.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 〈一句话功能简述〉<br> 
 * 〈〉
 *
 * @author 周宏硕
 * @create 2018/10/29
 * @since 1.0.0
 */
@Service("UserService")
@Transactional
public class UserServiceImpl implements UserService {

    @Autowired
    private UserDao userDao;

    @Override
    public List<User> findUserBywxId(String wxId) {
        return userDao.findUserBywxId(wxId);
    }


    @Override
    public Integer insertUser(User user) {
        return userDao.insertUser(user);
    }

    @Override
    public String updateUser(User user) {
        String state ="";
        int i = userDao.updateUser(user);
        if(i > 0) {
            state = "ok";
        }else {
            state = "no";
        }
        return state;
    }

    @Override
    public Integer deleteUser(Integer user_id) {
        return  userDao.deleteUser(user_id);
    }

}
